home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / fprotems.zip / PROWINDO.TEM < prev    next >
Text File  |  1993-01-04  |  3KB  |  111 lines

  1. <<title Template for FoxPro windows>>
  2. <<uicode>>
  3. * PROWINDO.TEM
  4. * Last modified 12/19/89
  5. * load libraries used by this template
  6.  
  7. load_lib("prowindo")
  8.  
  9. <<enduicode>>
  10.  
  11. <<* program header>>
  12.  
  13. *** {file} : Code to define and display FoxPro windows.
  14. *** Generated: {template}, {date}, {time} from {wwfile} screen.
  15.  
  16. *** DBF setup
  17. <<init_all_dbfs()>>
  18.  
  19. <<* init and locate fields>>
  20. <<declare_field_dupes()>>
  21. <<for all fields where field.input>>
  22.    {dupe_name(field)} = {var_init_val(field)}
  23.    <<if len(field.owner.name)>>
  24.    * {field.name} lives in {field.owner.name} WINDOW
  25.    <<else>>
  26.    {field.name} doesn't live in a window.
  27.    <<endif>>
  28. <<endfor>>
  29.  
  30. <<*init and locate memvars>>
  31. <<for all memvars where memvar.input>>
  32.    <<init_var(memvar)>>
  33.    <<* {memvar.name} lives in {memvar.owner.name} WINDOW>>
  34.     <<if len({memvar.owner.name})>>
  35.    * {memvar.name} lives in {memvar.owner.name} WINDOW.
  36.    <<else>>
  37.    * {memvar.name} doesn't live in a window.
  38.    <<endif>>
  39. <<endfor>>
  40.  
  41. <<for all memvars where ! memvar.input>>
  42.    <<init_var(memvar)>>
  43.    <<if len(memvar.owner.name)>>
  44.    * {memvar.name} lives in {memvar.owner.name} WINDOW
  45.    <<else>>
  46.    * {memvar.name} doesn't live in a window.
  47.    <<endif>>
  48. <<endfor>>
  49.  
  50. <<write_testcode()>>
  51.  
  52. *** define each window
  53. PROCEDURE WINDEFS
  54. <<declare_all_windows()>>
  55. <<uicode>>
  56. for all boxes where at("WINDOW", upper(box.descrip)) 
  57.    ? 'PROCEDURE open{substr(box.name,1,4)}'
  58.    ? '  IF WEXIST("{box.name}") '       ** If window previously defined,
  59.    ? '    IF WVISIBLE("{box.name}")'    ** and is on screen already,
  60.    ? '      RELEASE WINDOWS {box.name}' ** release it to avoid error.
  61.    ? '    ENDIF '
  62.    ? '  ENDIF'
  63.    ? 'ACTIVATE WINDOW {box.name}'
  64.    ? '* interior text of {box.name} window'
  65.    
  66.    write_window_text(box) 
  67.    
  68.    *** display non-input fields and memory variables
  69.    for all vars where ! var.input .and. var.owner = {box} 
  70.       say_var_in_window(box,var) 
  71.    endfor 
  72.    
  73.    *** position input fields and memory variables in the window
  74.    for all fields 
  75.       if field.owner = {box} .and. field.input 
  76.          get_field_dupe_in_window(box,field) 
  77.       endif 
  78.    endfor 
  79.    
  80.    *** put the input memvars in the window 
  81.    for all memvars 
  82.       if memvar.owner = {box} .and. memvar.input 
  83.          get_var_in_window(box,memvar) 
  84.       endif 
  85.    endfor 
  86.  
  87.   if box_wants_input() 
  88.   * i.e., has any variable that is tagged 'input' in there.
  89.      ? 'READ'
  90.   endif 
  91.  
  92.   ? 'RETURN'
  93.   ?
  94.   
  95. endfor 
  96.  
  97. ***********for_testing*********************
  98. function write_testcode                  **
  99. *******************************************
  100. * Call to this function can be commented out.
  101. * Un-comment it to test the generated code from the Fox command surface.
  102. ? '* Code for TESTING {file} generated by PROWINDO.TEM in FoxPro '
  103. ? 'DO WINDEFS '
  104. for all boxes where at("WINDOW", upper(box.descrip))
  105.    ? 'DO open{substr(box.name,1,4)} '
  106. next
  107. ? 'RETURN'
  108. return
  109. <<enduicode>>
  110.  
  111.